
console.log('plugin start');
chrome.runtime.onMessage.addListener(
	function(request, sender, sendResponse){
		if (request.action === 'notify'){
			console.log(request.text);
			if(chrome.notifications){
				var opt = {
					type: "basic",
					title: "copy show",
					message: request.text,
					iconUrl: "ndd.png"
					};
				chrome.notifications.create('', opt, (id)=>{
					setTimeout(()=>{
						chrome.notifications.clear(id,()=>{});
						}, 30000);
					});
			}
		}
		return true; // 保留消息通道打开，以便异步发送响应
	}
);


